Conventional computer systems typically include several functional components. These components may include a central processing unit (CPU), main memory, input/output (“I/O”) devices, and mass storage. In conventional systems, the main memory is coupled to the CPU via a system bus or a local memory bus. The main memory is used to provide the CPU access to data and/or program information that is stored in main memory at execution time. Typically, the main memory is composed of random access memory (RAM) circuits. A computer system with the CPU and main memory is often referred to as a host system.
Mass storage is typically used to retain data. Generally, a program stored in mass storage is copied to main memory before being executed by the CPU. Common mass storage devices include floppy disks, hard disks, optical disks and tape drives. Additionally, flash memory may be used to provide non-volatile storage for a host system.
A host system interfaces with flash memory (also referred to as “flash device”, “flash” or “flash card” interchangeably throughout this specification) via an interface. Flash memory typically includes non-volatile memory cell arrays for storing information. Flash memory systems are most commonly provided in the form of a memory card or flash drive that is removably connected with a variety of hosts such as a personal computer, a camera or the like, but may also be embedded within such host systems.
A flash memory controller typically controls the operations of a memory array. The memory controller includes a microprocessor, some non-volatile read only memory (“ROM”), a volatile random-access memory (“RAM”) and one or more special circuits, for example, an error correction-code circuit (“ECC”) that calculates ECC from data as it passes through the memory controller.
In an early generation of commercial flash memory systems, a rectangular array of memory cells were divided into a large number of groups of cells that each stored the amount of data of a standard disk drive sector, namely 512 bytes. An additional amount of data, such as 16 bytes, are also usually included in each group to store an error correction code (ECC) and possibly other overhead data relating to the user data and/or to the memory cell group in which it is stored. The memory cells in each such group are the minimum number of memory cells that are erasable together. That is, the erase unit is effectively the number of memory cells that store one data sector and any overhead data that is included. Examples of this type of memory system are described in U.S. Pat. Nos. 5,602,987 and 6,426,893. It is a characteristic of flash memory that the memory cells need to be erased prior to re-programming them with data.
When writing data to the flash memory via a logical interface, the host typically assigns unique logical addresses to sectors, clusters or other units of data within a continuous virtual address space of the memory system. The host typically maintains a file system and allocates file data to logical clusters, where the cluster size is typically fixed. A flash device is divided into plural logical sectors and the host allocates space within the clusters comprising of a plurality of logical sectors. A cluster is a sub-division of logical addresses and a cluster map is designated as a file allocation table (“FAT”). The FAT is normally stored on the storage device itself.
Like a disk operating system (DOS), the host writes data to, and reads data from, addresses within the logical address space of the memory system. A controller within the memory system translates logical addresses received from the host into physical addresses within the memory array, where the data are actually stored, and then keeps track of these address translations.
Typically, a memory device (for example, flash memory) is partitioned by the host system. Normally two partitions share a drive and each partition size is set by the host system. If one partition gets full and the other partition has more space left at any given time, it is useful to re-allocate the amount of space assigned to each partition. In conventional systems, the host performs this function by re-formatting the drive. This process involves copying all the data from the drive before reformatting and then re-allocating space to each partition. This process is tedious and time consuming, and hence undesirable.
Therefore, there is a need for a method and system that efficiently manages partitions for optimum usage of memory storage space.